{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import datasets, linear_model\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df = pd.read_csv('data\\pfm_train.csv')\n",
    "test_df = pd.read_csv('data\\pfm_test.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Age</th>\n",
       "      <th>Attrition</th>\n",
       "      <th>DistanceFromHome</th>\n",
       "      <th>Education</th>\n",
       "      <th>EmployeeNumber</th>\n",
       "      <th>EnvironmentSatisfaction</th>\n",
       "      <th>JobInvolvement</th>\n",
       "      <th>JobLevel</th>\n",
       "      <th>JobSatisfaction</th>\n",
       "      <th>MonthlyIncome</th>\n",
       "      <th>...</th>\n",
       "      <th>RelationshipSatisfaction</th>\n",
       "      <th>StandardHours</th>\n",
       "      <th>StockOptionLevel</th>\n",
       "      <th>TotalWorkingYears</th>\n",
       "      <th>TrainingTimesLastYear</th>\n",
       "      <th>WorkLifeBalance</th>\n",
       "      <th>YearsAtCompany</th>\n",
       "      <th>YearsInCurrentRole</th>\n",
       "      <th>YearsSinceLastPromotion</th>\n",
       "      <th>YearsWithCurrManager</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.0</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "      <td>1100.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>36.999091</td>\n",
       "      <td>0.161818</td>\n",
       "      <td>9.427273</td>\n",
       "      <td>2.922727</td>\n",
       "      <td>1028.157273</td>\n",
       "      <td>2.725455</td>\n",
       "      <td>2.730909</td>\n",
       "      <td>2.054545</td>\n",
       "      <td>2.732727</td>\n",
       "      <td>6483.620909</td>\n",
       "      <td>...</td>\n",
       "      <td>2.696364</td>\n",
       "      <td>80.0</td>\n",
       "      <td>0.788182</td>\n",
       "      <td>11.221818</td>\n",
       "      <td>2.807273</td>\n",
       "      <td>2.746364</td>\n",
       "      <td>7.011818</td>\n",
       "      <td>4.207273</td>\n",
       "      <td>2.226364</td>\n",
       "      <td>4.123636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>9.037230</td>\n",
       "      <td>0.368451</td>\n",
       "      <td>8.196694</td>\n",
       "      <td>1.022242</td>\n",
       "      <td>598.915204</td>\n",
       "      <td>1.098053</td>\n",
       "      <td>0.706366</td>\n",
       "      <td>1.107805</td>\n",
       "      <td>1.109731</td>\n",
       "      <td>4715.293419</td>\n",
       "      <td>...</td>\n",
       "      <td>1.095356</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.843347</td>\n",
       "      <td>7.825548</td>\n",
       "      <td>1.291514</td>\n",
       "      <td>0.701121</td>\n",
       "      <td>6.223093</td>\n",
       "      <td>3.618115</td>\n",
       "      <td>3.313830</td>\n",
       "      <td>3.597996</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>18.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1009.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>80.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>30.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>504.250000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2924.500000</td>\n",
       "      <td>...</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>80.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>6.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>2.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>36.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>1026.500000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>4857.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>80.0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>43.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>1556.500000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>8354.500000</td>\n",
       "      <td>...</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>80.0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>7.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>60.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>2065.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>19999.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>80.0</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>40.000000</td>\n",
       "      <td>6.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>37.000000</td>\n",
       "      <td>18.000000</td>\n",
       "      <td>15.000000</td>\n",
       "      <td>17.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               Age    Attrition  DistanceFromHome    Education  \\\n",
       "count  1100.000000  1100.000000       1100.000000  1100.000000   \n",
       "mean     36.999091     0.161818          9.427273     2.922727   \n",
       "std       9.037230     0.368451          8.196694     1.022242   \n",
       "min      18.000000     0.000000          1.000000     1.000000   \n",
       "25%      30.000000     0.000000          2.000000     2.000000   \n",
       "50%      36.000000     0.000000          7.000000     3.000000   \n",
       "75%      43.000000     0.000000         15.000000     4.000000   \n",
       "max      60.000000     1.000000         29.000000     5.000000   \n",
       "\n",
       "       EmployeeNumber  EnvironmentSatisfaction  JobInvolvement     JobLevel  \\\n",
       "count     1100.000000              1100.000000     1100.000000  1100.000000   \n",
       "mean      1028.157273                 2.725455        2.730909     2.054545   \n",
       "std        598.915204                 1.098053        0.706366     1.107805   \n",
       "min          1.000000                 1.000000        1.000000     1.000000   \n",
       "25%        504.250000                 2.000000        2.000000     1.000000   \n",
       "50%       1026.500000                 3.000000        3.000000     2.000000   \n",
       "75%       1556.500000                 4.000000        3.000000     3.000000   \n",
       "max       2065.000000                 4.000000        4.000000     5.000000   \n",
       "\n",
       "       JobSatisfaction  MonthlyIncome          ...           \\\n",
       "count      1100.000000    1100.000000          ...            \n",
       "mean          2.732727    6483.620909          ...            \n",
       "std           1.109731    4715.293419          ...            \n",
       "min           1.000000    1009.000000          ...            \n",
       "25%           2.000000    2924.500000          ...            \n",
       "50%           3.000000    4857.000000          ...            \n",
       "75%           4.000000    8354.500000          ...            \n",
       "max           4.000000   19999.000000          ...            \n",
       "\n",
       "       RelationshipSatisfaction  StandardHours  StockOptionLevel  \\\n",
       "count               1100.000000         1100.0       1100.000000   \n",
       "mean                   2.696364           80.0          0.788182   \n",
       "std                    1.095356            0.0          0.843347   \n",
       "min                    1.000000           80.0          0.000000   \n",
       "25%                    2.000000           80.0          0.000000   \n",
       "50%                    3.000000           80.0          1.000000   \n",
       "75%                    4.000000           80.0          1.000000   \n",
       "max                    4.000000           80.0          3.000000   \n",
       "\n",
       "       TotalWorkingYears  TrainingTimesLastYear  WorkLifeBalance  \\\n",
       "count        1100.000000            1100.000000      1100.000000   \n",
       "mean           11.221818               2.807273         2.746364   \n",
       "std             7.825548               1.291514         0.701121   \n",
       "min             0.000000               0.000000         1.000000   \n",
       "25%             6.000000               2.000000         2.000000   \n",
       "50%            10.000000               3.000000         3.000000   \n",
       "75%            15.000000               3.000000         3.000000   \n",
       "max            40.000000               6.000000         4.000000   \n",
       "\n",
       "       YearsAtCompany  YearsInCurrentRole  YearsSinceLastPromotion  \\\n",
       "count     1100.000000         1100.000000              1100.000000   \n",
       "mean         7.011818            4.207273                 2.226364   \n",
       "std          6.223093            3.618115                 3.313830   \n",
       "min          0.000000            0.000000                 0.000000   \n",
       "25%          3.000000            2.000000                 0.000000   \n",
       "50%          5.000000            3.000000                 1.000000   \n",
       "75%          9.000000            7.000000                 3.000000   \n",
       "max         37.000000           18.000000                15.000000   \n",
       "\n",
       "       YearsWithCurrManager  \n",
       "count           1100.000000  \n",
       "mean               4.123636  \n",
       "std                3.597996  \n",
       "min                0.000000  \n",
       "25%                2.000000  \n",
       "50%                3.000000  \n",
       "75%                7.000000  \n",
       "max               17.000000  \n",
       "\n",
       "[8 rows x 23 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df=train_df.drop(['Over18','StandardHours','EmployeeNumber'],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x22de310a710>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAELCAYAAADDZxFQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAHXNJREFUeJzt3X2cVWW99/HPV0AxQeVJQwYCk0pLJR0fjoVZeFLpCGaZaAUK3kQ3pT1oYd3H0Oo+WnlrPqQ3RzTQBDwW4vEgZQj5lCLohASWZCgjpohCmprB+Z0/1rVhOyxm9gyzZs/A9/167dde61rXWuvas/fs777W2vtaigjMzMwa2qXaDTAzs/bJAWFmZrkcEGZmlssBYWZmuRwQZmaWywFhZma5HBBmZpbLAWFmZrkcEGZmlqtztRuwPXr37h0DBw6sdjPMzDqUJUuWvBQRfZqq16EDYuDAgSxevLjazTAz61AkPVNJPR9iMjOzXA4IMzPL5YAwM7NcHfochJlZkf7xj39QX1/Pm2++We2mtEjXrl2pqamhS5cuLVrfAWFmtg319fV0796dgQMHIqnazWmWiGDdunXU19czaNCgFm3Dh5jMzLbhzTffpFevXh0uHAAk0atXr+3q/TggzMwa0RHDoWR72+6AMDOzXA4IM7Nmmj17NpJ48sknAVi1ahW33nrr5uV1dXXMnTt3m+svXryYc889F4CFCxfy0EMPbV52/fXXM3369IJa3jw7zUnqwy9oH3/w5ljyw9HVboKZ5ZgxYwYf/vCHmTlzJpMnT94cEGeeeSaQBcTixYsZPnz4Vutu3LiR2tpaamtrgSwgunXrxjHHHAPAhAkT2u6BNGGnCQgzs9bw2muv8eCDD7JgwQJGjBjB5MmTmTRpEitWrGDIkCGcccYZXHvttbzxxhs88MADXHjhhaxYsYI1a9awatUqevfuzfjx4/nRj37ENddcw/XXX0+nTp245ZZbuPrqq5k/fz7dunXj/PPPp66ujgkTJvD666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Z7AYOBR4EbJXUhG8a5TtloqftLuhr4L7LhM5oys2x6AHCbsivD7QaUhj+ZBXyDLCBGsWU8peOB96bhOAB6SNq9gn2abcWHmGyHExG/JRvErQ9lo6MmXVOdjWTjE/2c7FoY87axudJIqeWjpAr4cmy5mtygiPhVRNxHNrLuc8DNkkZHxCvAocBCYCLZKKpNKR8R9lqyK+gdDPxvtoxOez9wkKRewAi2DOsustFsS23rFxFvVLBPs604IGyHkwa16wSsI7swz0GSdlN2BbJhqU43YK+ImEs2Om5zrtX8S+CLqaeApPcoGwn2XcCLEfHvwFTgMGUjru4SET8nu8DNYc18OHsBzynrEowpFaZh3OeQXRfhd2XXpfg1WRCV/hYd/RrUVkU+xGQ7itI5CMg+RY9J17JYrey6AUvJRmktjcPfnWzU1K6pfqMnjxu4gexw02PpjXstWS/kOOACSf8gu7LcaLJLw96kLdfLvrCZj2syWe+gnuzKb33Lls0iu/xs+WijE4HrJJ1N9v+9gLLAMGsOD7VhZma5fIjJzMxyOSDMzCyXA8LMzHI5IMzMLJcDwszMcjkgzMwslwPCzMxyOSDMzCzX/wDEw7CfrT/ZGQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(x='BusinessTravel',hue='Attrition', data=train_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['Research & Development', 'Sales', 'Human Resources'], dtype=object)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df['Department'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    922\n",
       "1    178\n",
       "Name: Attrition, dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df['Attrition'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAGMCAYAAADA0jUwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xu8XdO99/HPVxLimkiEhh1NEOpSgqSlqOtR4ohLKapFaVN9ono/6HnqdlonPe1DqRapuFdQbdBWXQ7iVkrCdg2lhGxRIiUiQS5+zx9zbJZtZe+5L2vPufb+vl+v9Vprjjnnmr+5drJ+a4wx5xiKCMzMzFpaoegAzMysnJwgzMysKicIMzOrygnCzMyqcoIwM7OqnCDMzKwqJwizkpI0VNI9khZI+mnR8Vjv4wRRByS9VfF4T9LbFcuHFx1fV5J0haTFLc7580XHVZBjgTnAGhFxQmffTNJXJS2r+Fyfl3SRpJGdD7XDMV0h6dSCjr2RJN8I1goniDoQEas1P4AXgX0ryn7bnveS1Lc2UbZfK7GcUXnOEfH7duzbk3wceDI6cDdrK5/P3enf0QBgD2AJMF3Sph0Ps2Mk9enuY1r7OEH0AC1/hUnaQ9KsiuUmST+Q9BiwqKLsu5IekzRf0hRJK1Xsc6ykZyXNk3SdpKGp/EJJE1sc/8+Sjk+vGyRNlTQ3/UKdULHdjyVdnY61APhSO8+z2nm0drxVJF0u6XVJT0g6oflzkdRXUkga3srnOE7SI5LeSE09W7SIpbXP70BJjZLeTJ/jnpIOk/S3Fud0gqRrq5zr5cDhwA/Tr/1dJPWXdI6klyW9JOlMSSum7feQNEvSDyX9E/hNa59lRCyLiH9ExNeB+4BTKo69g6T703k3Svpsxbp7JP1E0vR03lMlrZnWrSDpWkn/TPtOq0w86fP9laSbJC0Evg4cUnGOUys+2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hfS7HAVItUuvg+MiYjXJV0C9K/YZiGtezc9v1fxunm5b4rnvyPighbxDG+x/TKyu7bNasZNTNarSBoCnA+cm6YIvRn4hqR+af3GFdOFfkrSiNT3cAhwD7AGWRKYL2kdYO9WDreA9s9LfTNwtKTVUjzrSVq7jX06chyzNrkGYb3BypIagX7AUuBy4My07kKyppqHJAmYC+yf1t0HTCTrg7gLmBoR70l6GHiCbM6He1s57iXA+ZLeBrbPE2hE3CJpU+C+LBzeAr5EVmPIdRz3Q1hX8VhMZlWkJqbvR8S/Fx2LWVHcxGRmZlW5BmFmZlW5BmFmZlU5QZiZWVVOEGZmVpUThJmZVeUEYWZmVTlBmJlZVf8fzar+HP/V8y8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "pd.crosstab(train_df.Department, train_df.Attrition).plot(kind='bar')\n",
    "plt.title('Turnover Frequency for Department')\n",
    "plt.xlabel('Department')\n",
    "plt.ylabel('Frequency of Turnover')\n",
    "plt.savefig('department_bar_chart')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEZCAYAAAB4hzlwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xm4VXXZ//H3R0BxYFDASg9DzjkgKc4TDuWQYb/yUTBLNPOxtOzRTC0vB7KyUXvUNE3SNEXFFCLEISHUUkBFVMjkUZSjaWCiOAvdvz/W92w3m33OWWdYZ3OOn9d17eus4bvvde991t73XtN3KSIwMzMDWKPWCZiZ2erDRcHMzEpcFMzMrMRFwczMSlwUzMysxE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zv/5Rbrv8ta6zRjT/ddjNnjv0xDz0wg3XWWZdjTvwGf3/ycS4461RY/i6bbrop48aNY/3112fEiBHssssuTJs2jaVLl3L11Vez11571fqtMTNrVN5eUltF0kGSnpK0QNIqXW1LOlXSPElzJf1Z0uD2Wva9d/6JPUbsz5BNNqNP377Mf/wxTjnrXD65827MmTOHM844g7Fjx3LkkUcyZ84cjjzySAAefvhhJk6cyA033FCKtfHAQfzX0cfypeO/xs133scOu+y+0rLO/taJfOus85g7dy7bbbcd559/fmne8uXLmTlzJhdffPFK083MVkeFFQVJ3YDLyE5n3RoYLWnrimaPAsPT1dETgJ+01/KnTryVg0Z+HoADR36BO8p2GzVl5MiRrL322rmXs+z111j2+msM320PAI455hhmzJhRmv/5z2c57LjjjixcuDB3XDOzWihy99HOwIKIeAZA0njgMLK7twEQEdPK2j8IHN0eC1766r+Z+cB9LHhqPpJYsWIFkthzv083+9x11123PVIoWWuttQDo1q0by5f7JC4zW70VuftoY2BR2Xh9mtaYrwB3tMeC7/7TRA49/EimPvg4d/xtLnfNfJKNBw5mDa3BW2+8UWrXq1cvli1blivmOuuux5tvvrHK9F69+9C7T18eeeivAFx33XXss88+7fEyzMw6XJFFodrVWFG1oXQ02dXTP21k/gmSZkuavXjx4mYXPHXirex/4KErTdv/kJFMnXQr3bp3Z/vtt+eiiy5i3333Zd68eQwbNoybbrqpyZj7fOog7p06mSMO3KtUABp8/6LL+cUPzmXo0KHMmTOHc845p9kczcxWR0XuPqoHBpaN1wEvVjaSdADwPWCfiHi3WqCIuBK4EmD48OFVC0u5q2+ZvMq0Lx7336XhoWV9FM2aNavROCNGjODSzYYBMGSTzZhw9wOleeUHm7faZjuun3T3SnEBpk+fXhru37+/jymY2WqvyC2FWcDmkj4uaU1gFBU36pH0SeDXwMiI+FeBuZiZWQ6FFYXUNcbJwJ3AfODmiHhS0lhJI1OznwLrAbdImiPJd3czM6uhQi9ei4gpwJSKaeeUDR9Q5PLNzKxlCr14zczMOhcXBTMzK3FRM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F1WtgfWLOdl9E9Hegz61K8pWBd0ceAJRHxLkBELInUK6qkc5R1bf2EpCur9SXUWBtJ0yX9UNJfgO9JelZSjzSvd/rV3iNPgpKOljQzbcX8WlI3SV+T9JOyNmMkXdJY+7a+SWbVuChYV3QXMFDSPyT9Sivfj+HSiNgpIrYl6/7j0CrPb6pN34jYJyLOB6aT9cEPMAq4NSLeby45SZ8g65xuj8i6PF4BfBGYQNYFeYMjgZuaaG/W7lwUrMtJV37uSNaZ3mKyL9Yxafa+kh6S9DhZ75vbVAnRVJubyoZ/Axybho8luyFMHvun/GZJmpPGN4mIxcAzknZVdmOkLcm6aK/aPueyzFrExxSsS4qIFWS/5KenL/djlHUn/itgeEQsknQe0LP8eZJ6NtPmzbJlPCBpSNoS6RYRT+RMT8C1EXFWlXk3kXVj/XfgtoiItPuqsfZm7cpbCtblSNpS0uZlk4aR3Ymu4ct9iaT1yLpbr5SnTbnfkd3NLe9WAsCfgcOV7put7Japg9O8PwCfA0bzwVZJU+3N2pW3FKwrWg+4RNnN6JcDC8jusrZU0lVkPU4uJLu/7UrytKnwe+ACssLQmLMlfatsGXWSzgbukrQG2e1dTyK7k9irkuYBW0fEzNR+XmPtm8nNrMXczYVZG6RrGw6LiC/VOhez9uAtBbNWSqeLHkx2I3mzLsFbCmZmVuIDzWZmVuKiYGZmJS4KZmZW4qJgZmYlLgpmZlbiomBmZiX/H6zRPUSv2upWAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "table=pd.crosstab(train_df.PercentSalaryHike, train_df.Attrition)\n",
    "table.div(table.sum(1).astype(float),axis=0).plot(kind='bar', stacked=True)\n",
    "plt.title('Stacked Bar Chart of Salary Level vs Turnover')\n",
    "plt.xlabel('Salary Level')\n",
    "plt.ylabel('Proportion of Employees')\n",
    "plt.savefig('salary_bar_char')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([18, 17, 24, 16, 15, 12, 13, 21, 11, 14, 20, 19, 22, 23, 25],\n",
       "      dtype=int64)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df.PercentSalaryHike.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Age', 'Attrition', 'BusinessTravel', 'Department', 'DistanceFromHome',\n",
       "       'Education', 'EducationField', 'EnvironmentSatisfaction', 'Gender',\n",
       "       'JobInvolvement', 'JobLevel', 'JobRole', 'JobSatisfaction',\n",
       "       'MaritalStatus', 'MonthlyIncome', 'NumCompaniesWorked', 'OverTime',\n",
       "       'PercentSalaryHike', 'PerformanceRating', 'RelationshipSatisfaction',\n",
       "       'StockOptionLevel', 'TotalWorkingYears', 'TrainingTimesLastYear',\n",
       "       'WorkLifeBalance', 'YearsAtCompany', 'YearsInCurrentRole',\n",
       "       'YearsSinceLastPromotion', 'YearsWithCurrManager'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df.shape\n",
    "train_df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df.OverTime.replace('Yes',1,inplace=True)\n",
    "train_df.OverTime.replace('No',0,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df.BusinessTravel.replace('Non-Travel',1,inplace=True)\n",
    "train_df.BusinessTravel.replace('Travel_Rarely',2,inplace=True)\n",
    "train_df.BusinessTravel.replace('Travel_Frequently',3,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 3, 1], dtype=int64)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df.BusinessTravel.unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "cat_vars=['Department','MaritalStatus','JobRole']\n",
    "for var in cat_vars:\n",
    "    cat_list='var'+'_'+var\n",
    "    cat_list=pd.get_dummies(train_df[var],prefix=var)\n",
    "    hrl=train_df.join(cat_list)\n",
    "train_df=hrl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Age', 'Attrition', 'BusinessTravel', 'DistanceFromHome', 'Education',\n",
       "       'EnvironmentSatisfaction', 'Gender', 'JobInvolvement', 'JobLevel',\n",
       "       'JobSatisfaction', 'MonthlyIncome', 'NumCompaniesWorked', 'OverTime',\n",
       "       'PercentSalaryHike', 'PerformanceRating', 'RelationshipSatisfaction',\n",
       "       'StockOptionLevel', 'TotalWorkingYears', 'TrainingTimesLastYear',\n",
       "       'WorkLifeBalance', 'YearsAtCompany', 'YearsInCurrentRole',\n",
       "       'YearsSinceLastPromotion', 'YearsWithCurrManager',\n",
       "       'JobRole_Healthcare Representative', 'JobRole_Human Resources',\n",
       "       'JobRole_Laboratory Technician', 'JobRole_Manager',\n",
       "       'JobRole_Manufacturing Director', 'JobRole_Research Director',\n",
       "       'JobRole_Research Scientist', 'JobRole_Sales Executive',\n",
       "       'JobRole_Sales Representative'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "drop_cols = ['Department','MaritalStatus','JobRole','EducationField']\n",
    "train_df.drop(columns=drop_cols,inplace=True)\n",
    "train_df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_df.Gender.replace('Male',0,inplace=True)\n",
    "train_df.Gender.replace('Female',1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(train_df.columns.tolist())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Age', 'Attrition', 'BusinessTravel', 'DistanceFromHome', 'Education',\n",
       "       'EnvironmentSatisfaction', 'Gender', 'JobInvolvement', 'JobLevel',\n",
       "       'JobSatisfaction', 'MonthlyIncome', 'NumCompaniesWorked', 'OverTime',\n",
       "       'PercentSalaryHike', 'PerformanceRating', 'RelationshipSatisfaction',\n",
       "       'StockOptionLevel', 'TotalWorkingYears', 'TrainingTimesLastYear',\n",
       "       'WorkLifeBalance', 'YearsAtCompany', 'YearsInCurrentRole',\n",
       "       'YearsSinceLastPromotion', 'YearsWithCurrManager',\n",
       "       'JobRole_Healthcare Representative', 'JobRole_Human Resources',\n",
       "       'JobRole_Laboratory Technician', 'JobRole_Manager',\n",
       "       'JobRole_Manufacturing Director', 'JobRole_Research Director',\n",
       "       'JobRole_Research Scientist', 'JobRole_Sales Executive',\n",
       "       'JobRole_Sales Representative'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "hr_vars=train_df.columns.values.tolist()\n",
    "y=['Attrition']\n",
    "X=[i for i in hr_vars if i not in y]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1100 entries, 0 to 1099\n",
      "Data columns (total 33 columns):\n",
      "Age                                  1100 non-null int64\n",
      "Attrition                            1100 non-null int64\n",
      "BusinessTravel                       1100 non-null int64\n",
      "DistanceFromHome                     1100 non-null int64\n",
      "Education                            1100 non-null int64\n",
      "EnvironmentSatisfaction              1100 non-null int64\n",
      "Gender                               1100 non-null int64\n",
      "JobInvolvement                       1100 non-null int64\n",
      "JobLevel                             1100 non-null int64\n",
      "JobSatisfaction                      1100 non-null int64\n",
      "MonthlyIncome                        1100 non-null int64\n",
      "NumCompaniesWorked                   1100 non-null int64\n",
      "OverTime                             1100 non-null int64\n",
      "PercentSalaryHike                    1100 non-null int64\n",
      "PerformanceRating                    1100 non-null int64\n",
      "RelationshipSatisfaction             1100 non-null int64\n",
      "StockOptionLevel                     1100 non-null int64\n",
      "TotalWorkingYears                    1100 non-null int64\n",
      "TrainingTimesLastYear                1100 non-null int64\n",
      "WorkLifeBalance                      1100 non-null int64\n",
      "YearsAtCompany                       1100 non-null int64\n",
      "YearsInCurrentRole                   1100 non-null int64\n",
      "YearsSinceLastPromotion              1100 non-null int64\n",
      "YearsWithCurrManager                 1100 non-null int64\n",
      "JobRole_Healthcare Representative    1100 non-null uint8\n",
      "JobRole_Human Resources              1100 non-null uint8\n",
      "JobRole_Laboratory Technician        1100 non-null uint8\n",
      "JobRole_Manager                      1100 non-null uint8\n",
      "JobRole_Manufacturing Director       1100 non-null uint8\n",
      "JobRole_Research Director            1100 non-null uint8\n",
      "JobRole_Research Scientist           1100 non-null uint8\n",
      "JobRole_Sales Executive              1100 non-null uint8\n",
      "JobRole_Sales Representative         1100 non-null uint8\n",
      "dtypes: int64(24), uint8(9)\n",
      "memory usage: 216.0 KB\n"
     ]
    }
   ],
   "source": [
    "hr = train_df\n",
    "hr.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\utils\\validation.py:761: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
      "  y = column_or_1d(y, warn=True)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[False  True False False  True  True  True False  True False False  True\n",
      " False False False  True False False  True False False False False  True\n",
      "  True  True False  True  True False  True  True]\n",
      "[15  1 14 12  1  1  1 17  1 18  6  1 16  2  3  1  8  5  1 10  4  7  9  1\n",
      "  1  1 13  1  1 11  1  1]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n",
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.feature_selection import RFE\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "model = LogisticRegression()\n",
    "rfe = RFE(model, 15)\n",
    "rfe = rfe.fit(hr[X], hr[y])\n",
    "print(rfe.support_)\n",
    "print(rfe.ranking_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Age', 'Attrition', 'BusinessTravel', 'DistanceFromHome', 'Education',\n",
       "       'EnvironmentSatisfaction', 'Gender', 'JobInvolvement', 'JobLevel',\n",
       "       'JobSatisfaction', 'MonthlyIncome', 'NumCompaniesWorked', 'OverTime',\n",
       "       'PercentSalaryHike', 'PerformanceRating', 'RelationshipSatisfaction',\n",
       "       'StockOptionLevel', 'TotalWorkingYears', 'TrainingTimesLastYear',\n",
       "       'WorkLifeBalance', 'YearsAtCompany', 'YearsInCurrentRole',\n",
       "       'YearsSinceLastPromotion', 'YearsWithCurrManager',\n",
       "       'JobRole_Healthcare Representative', 'JobRole_Human Resources',\n",
       "       'JobRole_Laboratory Technician', 'JobRole_Manager',\n",
       "       'JobRole_Manufacturing Director', 'JobRole_Research Director',\n",
       "       'JobRole_Research Scientist', 'JobRole_Sales Executive',\n",
       "       'JobRole_Sales Representative'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hr.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(hr.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "cols=['BusinessTravel','EnvironmentSatisfaction', 'Gender', 'JobInvolvement', 'JobSatisfaction', 'OverTime'\n",
    "      ,'StockOptionLevel','WorkLifeBalance',  'JobRole_Healthcare Representative', 'JobRole_Human Resources',\n",
    "       'JobRole_Laboratory Technician','JobRole_Manufacturing Director', 'JobRole_Research Director', 'JobRole_Sales Executive',\n",
    "       'JobRole_Sales Representative']\n",
    "\n",
    "X=hr[cols]\n",
    "y=hr['Attrition']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\linear_model\\logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='warn',\n",
       "          n_jobs=None, penalty='l2', random_state=None, solver='warn',\n",
       "          tol=0.0001, verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.219, random_state=0)\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn import metrics\n",
    "logreg = LogisticRegression()\n",
    "logreg.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Logistic regression accuracy: 0.887967\n"
     ]
    }
   ],
   "source": [
    "from sklearn.metrics import accuracy_score\n",
    "print('Logistic regression accuracy: {:.6f}'.format(accuracy_score(y_test, logreg.predict(X_test))))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "随机森林"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Random Forest Accuracy: 0.83817\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\ensemble\\forest.py:246: FutureWarning: The default value of n_estimators will change from 10 in version 0.20 to 100 in 0.22.\n",
      "  \"10 in version 0.20 to 100 in 0.22.\", FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "rf = RandomForestClassifier()\n",
    "rf.fit(X_train, y_train)\n",
    "print('Random Forest Accuracy: {:.5f}'.format(accuracy_score(y_test, rf.predict(X_test))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Support vector machine accuracy: 0.86307\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\Anaconda\\envs\\Pytorch-CUDA10.0\\lib\\site-packages\\sklearn\\svm\\base.py:196: FutureWarning: The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning.\n",
      "  \"avoid this warning.\", FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.svm import SVC\n",
    "svc = SVC()\n",
    "svc.fit(X_train, y_train)\n",
    "print(\"Support vector machine accuracy: {:.5f}\".format(accuracy_score(y_test, svc.predict(X_test))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
      "  decision_function_shape='ovr', degree=3, gamma='auto_deprecated',\n",
      "  kernel='rbf', max_iter=-1, probability=False, random_state=None,\n",
      "  shrinking=True, tol=0.001, verbose=False)\n"
     ]
    }
   ],
   "source": [
    "print(SVC())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
